<template>
	<view class="mcontent">
		<view class="cu-bar bg-gradual-blue">
			<view class="action" @tap="back">
				<text class="cuIcon-back" ></text> 返回
			</view>
			<view class="content text-bold">
				搜索结果
			</view>
		</view>
	
		
	<scroll-view scroll-y style="height: 90%;" >
		<view v-if="!content" class="solids-bottom padding-xs flex align-center">
			
			<view class="flex-sub text-center">
				<view class="solid-bottom text-xsl padding">
					<text class=" cuIcon-roundcheckfill text-green"></text>
				</view>
				<view class="padding">找不到数据</view>
			</view>
		</view>
	<view class="cu-card article"  v-for="(item, index) in content" :key="index" @click="navToDetails(item)">
		<view class="cu-item shadow">
			<view class="title"><view class="text-cut">{{item.Title}}</view></view>
			<view class="content">
				<image v-if="item.imgUrl" :src="item.imgUrl"
				 mode="aspectFill"></image>
				<view class="desc">
					<view class="text-content"> {{item.Title}}</view>
					<view>
						<view v-if="item.hotDesc" class="cu-tag bg-red light sm round">{{item.hotDesc}}</view>
						<view v-if="item.type" class="cu-tag bg-green light sm round">{{item.type}}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
	</scroll-view>
	</view>
</template>

<script>
	export default {
		
		data() {
			return {
				key:null,
				content:null
			}
		},
		onLoad(options){
			this.$api.searchKey(options.data).then((res)=>{
				console.log(res.data.Data)
				this.content = res.data.Data
			})
		},
		methods: {
			//新闻详情
			navToDetails(item){
				window.open(item.Url,'_blank');  
			},
			back(){
				uni.navigateBack()
			}
		
		}
	}
</script>

<style lang="scss">
	page{
		height: 100%;
	}
	page, .mcontent{
		
		height: 100%;
		
	}
	
	
</style>
